package com.hj.ct.db;

public class DBConstants {
	public final static String SQL_USER_TABLE = "user";
	public final static String SQL_ALARM_TABLE = "alarm";
	public final static String SQL_DEVICE_TABLE = "device";
	public final static String SQL_GATHER_TABLE = "gather";

	public final static String SQL_USER = "CREATE TABLE IF NOT EXISTS "
			+ SQL_USER_TABLE
			+ "(id INTEGER PRIMARY KEY AUTOINCREMENT,"
			+ "userName TEXT, "
			+ "password TEXT, "
			+ "UNIQUE ('userName') ON CONFLICT IGNORE)";

	public final static String SQL_ALARM = "CREATE TABLE IF NOT EXISTS "
			+ SQL_ALARM_TABLE
			+ "(id INTEGER PRIMARY KEY AUTOINCREMENT,"
			+ "DeviceID TEXT," 
			+ "DustAlarmType TEXT," 
			+ "DustHi_Day TEXT, "
			+ "DustHi_Night TEXT, "
			+ "DustDelay TEXT,"
			+ "NoiseAlarmType TEXT, "
			+ "NoiseHi_Day TEXT, "
			+ "NoiseHi_Night TEXT,"
			+ "NoiseDelay TEXT, "
			+ "DayTimeStart TEXT, "
			+ "NightTimeStart TEXT,"
			+ "UNIQUE ('DeviceID') ON CONFLICT IGNORE)";
	

	                
	public final static String SQL_DEVICE = "CREATE TABLE IF NOT EXISTS "
			+ SQL_DEVICE_TABLE
			+ "(id INTEGER PRIMARY KEY AUTOINCREMENT,"
			+ "deviceID TEXT, "
			+ "deviceName TEXT, "
			+ "deviceDesc TEXT," 
			+ "latitude TEXT," 
			+ "longitude TEXT," 
			+ "img TEXT," 
			+ "UNIQUE ('deviceID') ON CONFLICT IGNORE)";
	
	public final static String SQL_GATHER = "CREATE TABLE IF NOT EXISTS "
			+ SQL_GATHER_TABLE
			+ "(id INTEGER PRIMARY KEY AUTOINCREMENT,"
			+ "isReal TEXT,"
			+ "recTime TEXT,"
			+ "deviceID TEXT,"
			+ "LAFRealTime TEXT," 
			+ "LAFMaxPrf TEXT," 
			+ "LAeqPrf TEXT," 
			+ "LCpeakPrf TEXT," 
			+ "LAMaxPer TEXT," 
			+ "LAwqPer TEXT," 
			+ "LAF10Per TEXT," 
			+ "LAF90Per TEXT," 
			+ "LAF95Per TEXT," 
			+ "dustInst TEXT," 
			+ "Latitude TEXT," 
			+ "Longitude TEXT," 
			+ "windSP TEXT," 
			+ "windDir TEXT," 
			+ "tempreture TEXT," 
			+ "humidity TEXT," 
			+ "pressure TEXT," 
			+ "UNIQUE ('recTime','isReal') ON CONFLICT IGNORE)";
	
}